import request from "@/utils/request";

// 获得类目分页
export function getCategoryPage(query) {
  return request({
    url: "/order/category/page",
    method: "get",
    params: query,
  });
}

// 查询全部类目
export function getCategoryAll(query) {
  return request({
    url: "/order/category/all",
    method: "get",
    params: query,
  });
}

// 创建类目
export function CreateCategory(data) {
  return request({
    url: "/order/category/create",
    method: "post",
    data: data,
  });
}

// 更新类目
export function UpdateCategory(data) {
  return request({
    url: "/order/category/update",
    method: "PUT",
    data: data,
  });
}

// 获得类目
export function getCategory(query) {
  return request({
    url: "/order/category/get",
    method: "get",
    params: query,
  });
}

// 删除类目
export function DeleteCategory(query) {
  return request({
    url: "/order/category/delete",
    method: "delete",
    params: query,
  });
}

// 获得类目金额分页
export function getCategoryAmountPage(data) {
  return request({
    url: "/order/category-money/page",
    method: "POST",
    data: data,
  });
}

// 创建类目金额
export function CreateCategoryAmount(data) {
  return request({
    url: "/order/category-money/create",
    method: "post",
    data: data,
  });
}

// 编辑类目金额
export function EditCategoryMoney(data) {
  return request({
    url: "/order/category-money/edit",
    method: "post",
    data: data,
  });
}

// 获得类目金额
export function getCategoryAmount(query) {
  return request({
    url: "/order/category-money/info",
    method: "get",
    params: query,
  });
}

// 删除类目金额
export function DeleteCategoryAmount(query) {
  return request({
    url: "order/category-money/delete",
    method: "delete",
    params: query,
  });
}

// 查询全部类目
export function getAllCategory(query) {
  return request({
    url: "/order/category/all",
    method: "get",
    params: query,
  });
}

// 类目金额统计
export function getTotalCategoryAmount(data) {
  return request({
    url: "/order/category-money/sum",
    method: "post",
    data: data,
  });
}

// 下载导入模板
export function downloadTemp() {
  return request({
    url: "/order/category-money/import/temp",
    method: "post",
    responseType: "blob",
  });
}

// 导入类目金额回执下载
export function impFinishDown(query) {
  return request({
    url: "/order/category-money/import/finish/down",
    method: "get",
    params: query,
    responseType: "blob",
  });
}

// 导入类目金额查询完成状态
export function impFinish(query) {
  return request({
    url: "/order/category-money/import/finish",
    method: "get",
    params: query,
  });
}

// 删除类目金额(批量)
export function DeleteCategoryAmountBatch(data) {
  return request({
    url: "/order/category-money/delete/batch",
    method: "post",
    data: data,
  });
}
